package balance

import (
	"errors"
	"math/rand"
)

type RandomBalance struct {
	
}

func (r *RandomBalance) balance(hostList []*Instance) (resultInstance *Instance,err error){
	if len(hostList) == 0 {
		err = errors.New("noServiceException")
		return
	}
	resultInstance = hostList[rand.Intn(len(hostList))]
	return
}